var orderTableEvent=null;
/**
 * 页面初始化
 */
$(function () {
    
});

function showEventTab(){
      //售后信息
      if (orderTableEvent==null){
          orderTableEvent = $('#orderTableEvent').DataTable({
              "autoWidth": false,
              "processing": true,
              "serverSide": true,
              "dom": '<"bottom"rtflp>',
              "searching": false,
              "paging": false,
              "deferRender": true,
              "ordering": false,
              "ajax": {
                  "url": "/afterSale/getEventListByOrderId.action?orderId="+$('#myid', window.parent.document).val()
                  },
              "columns": [
                  {"data": "eventCode","orderable": false},
                  {
                      "data": "eventStatus","orderable": false,
                      "render": function ( data, type, row, meta ) {
                          if (row.eventStatus == "a") {
                              return "待处理";
                          } else if (row.eventStatus == "p") {
                              return "处理中";
                          } else if (row.eventStatus == "z") {
                              return "已完成";
                          } else {
                              return "&nbsp;";
                          }
                      }
                  },
                  {"data": "expireTime","orderable": false},
                  {"data": "eventCreator","orderable": false},
                  {"data": "createTime","orderable": false},
                  {"data": "planDealUserName","orderable": false},
                  {"data": "factDealUserName","orderable": false},
                  {"data": "remark","orderable": false}
                  ],
                  "order": [[4, "asc"]]
          });
          
       // 文字过长截断显示悬浮框
          $("#orderTableEvent").tooltip({
              selector: ".tooltip-column-detail-5",
              container: "body",
              title: function() {
                  if ($(this)[0].scrollWidth > $(this).outerWidth()) {
                      return $(this).text();
                  }
              }
          });
      } else {
          orderTableEvent.draw();
      }
}
